﻿using System;

namespace sy3_4
{
    class Truck
    {
        private int wheelCount;    // 车轮数
        private double weight;     // 车重量（吨）
        private double load;       // 载重量（吨）
        private double fuelConsump; // 耗油量（L/km）

        // 构造函数：初始化卡车属性
        public Truck(int wheelCount, double weight, double load, double fuelConsump)
        {
            this.wheelCount = wheelCount;
            this.weight = weight;
            this.load = load;
            this.fuelConsump = fuelConsump;
        }

        // 检测是否超载
        public bool IsOverload(double goodsWeight)
        {
            return goodsWeight > load;
        }

        // 计算行驶耗油量
        public double CalculateFuel(double distance)
        {
            return distance * fuelConsump;
        }
    }
}